1. Field of the Invention
The present invention relates generally to the field of graphics processing and, more specifically, to a system and method for determining the optimal graphics processing unit (GPU) initialization order in a multiple-GPU system.
2. Description of the Related Art
In conventional computer systems, the processing power of a central processing unit (CPU) may be augmented by a co-processor, such as a GPU. GPUs are specialized processors that are configured to efficiently perform graphics processing operations or other operations that would otherwise be performed by the CPU. Some conventional computer systems are configured with a hybrid graphics system that includes, for example, an integrated GPU (iGPU) disposed on the motherboard along with the CPU and a discrete GPU (dGPU) located on an add-in card that is connected to the motherboard via a Peripheral Component Interconnect Express (PCI Express or PCIe) expansion bus and slot.
In a hybrid graphics system, the iGPU and the dGPU operate in concert to perform different graphics processing operations. This arrangement is created to provide a graphics processing environment combining the inherently lower-power, longer battery-life of the iGPU with the higher performance dGPU, giving the user the best of both worlds. The iGPU is typically configured as the primary GPU, i.e., optimized for lower power consumption and longer battery-life and is the default adapter controlling critical graphics resources, such as the legacy VGA interface on which boot time power-on self-test and critical operating system messages are displayed, backlight control, hot-key display switch control and other interfaces as defined within the Advanced Configuration and Power Interface (ACPI). The iGPU is also coupled to the Video Graphics Array (VGA) adaptor of the computer system. The dGPU supplements the iGPU by providing the augmented graphics processing capabilities necessary for many different types of computationally intensive applications, including three-dimensional (3D) rendering and video gaming. However in order to realize the battery-life capabilities of the iGPU, the dGPU must be shutdown or placed into a low power mode when not in use. This transition may, for example be initiated by the user selecting a system policy preference for long battery-life, via a physical switch that allows selecting iGPU versus dGPU operating modes, or by removing the A/C mains power cord i.e. switching to battery power.
When a computer system configured with a hybrid graphics system is turned on, the order in which the iGPU and the dGPU are initialized by the operating system is non-deterministic, i.e., either GPU may be initialized first. Importantly, some operating systems may recognize the GPU that initializes as the Legacy VGA adapter as being the primary GPU. However other operating systems or other functionality within the operating system may instead recognize the first GPU adapter driver based on the Plug & Play order which may place the VGA adapter first if the devices are located on different busses or enumerated on those busses in different order. The net effect is a misalignment between the adapter initialized first and the actual primary adapter resulting in control over the critical graphics resources being assigned to the wrong GPU. In a scenario where the iGPU is initialized first, the iGPU is correctly recognized by the operating system as the primary GPU. However, in a scenario where the dGPU is initialized first, the dGPU is incorrectly recognized by the operating system as the primary GPU. In this latter scenario, control of the critical graphics resources described above is assigned to the dGPU. Since the operating system or the dGPU is not configured to optimally control those graphics resources, or the resource will likely disappear when the dGPU is powered down, then those graphics resources and, thereby, critical functions within the computer system may not operate normally. Further, in a hybrid graphics system, the dGPU may be powered off in certain power-saving modes. In such power-saving modes, if the dGPU is the primary GPU, then the dGPU is no longer available to control the critical graphics resources, potentially resulting in a large-scale system failure.
As the foregoing illustrates, what is needed in the art is an effective mechanism to initialize the GPUs in a hybrid graphics system in a pre-determined order for the optimal control of the critical graphics resources within the system.